<?
include ("./src/jpgraph.php"); 
include ("./src/jpgraph_pie.php"); 
$d = unserialize(stripslashes(urldecode($_GET['d'])));
$d2 = unserialize(stripslashes(urldecode($_GET['d2'])));
$l = unserialize(stripslashes(urldecode($_GET['l'])));

//print_r($l);
//print_r($d);

//$l = 

$graph = new PieGraph($_GET['w'],$_GET['h']); 
$graph->SetShadow(FALSE);
$graph->SetFrame(FALSE); 
//$graph->SetBackgroundGradient('#ffffff','gray9',GRAD_VER,BGRAD_FRAME);
$colors = array('bisque4','wheat1','chocolate3','gold2','darkgreen',
'lightsalmon','darkcyan','gray','chartrueuse3','burlywood2','khaki1','darkorange2');

$graph->title->Set($_GET['t']);
$graph->title->SetColor("gray3"); 


$graph->legend->SetFillColor("#ffffff");
$graph->legend->SetShadow();
$graph->legend->SetColumns(1);
$graph->legend->SetColor('blue','gray1'); 
$graph->legend->Pos(0.01, 0.1); 

//$graph->legend->SetLineWeight(0); 
$colors = array("earth", "pastel", "sand", "water"); 

$size=0.1;
$p1 = new PiePlot($d);
$p1->SetSize(0.23);
if($l) $p1->SetLegends($l); 
$p1->SetCenter(0.11,0.5);
$p1->SetTheme($colors[$_GET['c']]);
$p1->title->Set($_GET['t1']); 

$p2 = new PiePlot($d2);
$p2->SetSize(0.23);
$p2->SetCenter(0.44,0.5);
$p2->SetLabelType(PIE_VALUE_ABS);
$p2->value->SetFormat('$%d'); 
$p2->SetTheme($colors[$_GET['c']]);
$p2->value->SetFont(FF_FONT0);
$p2->title->Set($_GET['t2']); 

//$p1->ExplodeAll(10);

$graph->Add($p1); 
$graph->Add($p2); 
$graph->Stroke(); 
?>
